#ifndef __MESSAGE_ROUTER_H__
#define __MESSAGE_ROUTER_H__

#include "Vector.h"

class ILogger;
class String;
class IService;
/**
* Simple message broker. 
* Agregates set of services and distributes messages and clock ticks among them.
*/
class MessageRouter{
private:
	Vector<IService*> services_;
	ILogger& logger_;
public:
	MessageRouter(ILogger& logger);
	virtual void addService(IService& service);
	virtual void postMessage(const IService& sender, const String& msg);
	virtual void broadcastMessage(const String& msg);
	virtual void tick(long milliseconds);
	virtual IService* removeService(const String& name);
	virtual int getServicesSize() const;
	virtual const IService* getService(int pos) const;
};

#endif